home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / scregg.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  9KB  |  262 lines

  1. /***************************************************************************
  2.  
  3. Eggs
  4.  
  5. Very similar to Burger Time hardware (and uses its video driver)
  6.  
  7. driver by Nicola Salmoria
  8.  
  9. ***************************************************************************/
  10.  
  11. #include "driver.h"
  12. #include "vidhrdw/generic.h"
  13.  
  14.  
  15. /* from vidhrdw/btime.c */
  16. void btime_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  17. int  btime_vh_start (void);
  18. void eggs_vh_screenrefresh    (struct osd_bitmap *bitmap,int full_refresh);
  19.  
  20. READ_HANDLER( btime_mirrorvideoram_r );
  21. WRITE_HANDLER( btime_mirrorvideoram_w );
  22. READ_HANDLER( btime_mirrorcolorram_r );
  23. WRITE_HANDLER( btime_mirrorcolorram_w );
  24. WRITE_HANDLER( btime_video_control_w );
  25.  
  26.  
  27.  
  28. static struct MemoryReadAddress eggs_readmem[] =
  29. {
  30.     { 0x0000, 0x07ff, MRA_RAM },
  31.     { 0x1000, 0x17ff, MRA_RAM },
  32.     { 0x1800, 0x1bff, btime_mirrorvideoram_r },
  33.     { 0x1c00, 0x1fff, btime_mirrorcolorram_r },
  34.     { 0x2000, 0x2000, input_port_2_r },     /* DSW1 */
  35.     { 0x2001, 0x2001, input_port_3_r },     /* DSW2 */
  36.     { 0x2002, 0x2002, input_port_0_r },     /* IN0 */
  37.     { 0x2003, 0x2003, input_port_1_r },     /* IN1 */
  38.     { 0x3000, 0x7fff, MRA_ROM },
  39.     { 0xf000, 0xffff, MRA_ROM },    /* reset/interrupt vectors */
  40.     { -1 }  /* end of table */
  41. };
  42.  
  43. static struct MemoryWriteAddress eggs_writemem[] =
  44. {
  45.     { 0x0000, 0x07ff, MWA_RAM },
  46.     { 0x1000, 0x13ff, videoram_w, &videoram, &videoram_size },
  47.     { 0x1400, 0x17ff, colorram_w, &colorram },
  48.     { 0x1800, 0x1bff, btime_mirrorvideoram_w },
  49.     { 0x1c00, 0x1fff, btime_mirrorcolorram_w },
  50.     { 0x2000, 0x2000, btime_video_control_w },
  51.     { 0x2001, 0x2001, MWA_NOP },
  52.     { 0x2004, 0x2004, AY8910_control_port_0_w },
  53.     { 0x2005, 0x2005, AY8910_write_port_0_w },
  54.     { 0x2006, 0x2006, AY8910_control_port_1_w },
  55.     { 0x2007, 0x2007, AY8910_write_port_1_w },
  56.     { 0x3000, 0x7fff, MWA_ROM },
  57.     { -1 }  /* end of table */
  58. };
  59.  
  60.  
  61.  
  62. INPUT_PORTS_START( scregg )
  63.     PORT_START      /* IN0 */
  64.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  65.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY )
  66.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY )
  67.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY )
  68.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  69.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  70.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  71.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
  72.  
  73.     PORT_START      /* IN1 */
  74.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  75.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY | IPF_COCKTAIL )
  76.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY | IPF_COCKTAIL )
  77.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY | IPF_COCKTAIL )
  78.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  79.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  80.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
  81.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  82.  
  83.     PORT_START      /* DSW1 */
  84.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
  85.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  86.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  87.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
  88.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
  89.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
  90.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  91.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
  92.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
  93.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
  94.     PORT_BIT( 0x30, 0x30, IPT_UNKNOWN )     /* almost certainly unused */
  95.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
  96.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  97.     PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
  98.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK  )
  99.  
  100.     PORT_START      /* DSW2 */
  101.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
  102.     PORT_DIPSETTING(    0x01, "3" )
  103.     PORT_DIPSETTING(    0x00, "5" )
  104.     PORT_DIPNAME( 0x06, 0x04, DEF_STR( Bonus_Life ) )
  105.     PORT_DIPSETTING(    0x04, "30000" )
  106.     PORT_DIPSETTING(    0x02, "50000" )
  107.     PORT_DIPSETTING(    0x00, "70000"  )
  108.     PORT_DIPSETTING(    0x06, "Never"  )
  109.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )   /* almost certainly unused */
  110.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  111.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  112.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )   /* almost certainly unused */
  113.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  114.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  115.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )   /* almost certainly unused */
  116.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  117.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  118.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )   /* almost certainly unused */
  119.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  120.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  121.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Difficulty ) )
  122.     PORT_DIPSETTING(    0x80, "Easy" )
  123.     PORT_DIPSETTING(    0x00, "Hard" )
  124. INPUT_PORTS_END
  125.  
  126.  
  127.  
  128.  
  129. static struct GfxLayout charlayout =
  130. {
  131.     8,8,    /* 8*8 characters */
  132.     1024,   /* 1024 characters */
  133.     3,      /* 3 bits per pixel */
  134.     { 2*1024*8*8, 1024*8*8, 0 },    /* the bitplanes are separated */
  135.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  136.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  137.     8*8     /* every char takes 8 consecutive bytes */
  138. };
  139.  
  140. static struct GfxLayout spritelayout =
  141. {
  142.     16,16,  /* 16*16 sprites */
  143.     256,    /* 256 sprites */
  144.     3,      /* 3 bits per pixel */
  145.     { 2*256*16*16, 256*16*16, 0 },  /* the bitplanes are separated */
  146.     { 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7,
  147.       0, 1, 2, 3, 4, 5, 6, 7 },
  148.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  149.       8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  150.     32*8    /* every sprite takes 32 consecutive bytes */
  151. };
  152.  
  153. static struct GfxDecodeInfo gfxdecodeinfo[] =
  154. {
  155.     { REGION_GFX1, 0, &charlayout,          0, 1 },     /* char set #1 */
  156.     { REGION_GFX1, 0, &spritelayout,        0, 1 },     /* sprites */
  157.     { -1 } /* end of array */
  158. };
  159.  
  160.  
  161.  
  162. static struct AY8910interface ay8910_interface =
  163. {
  164.     2,      /* 2 chips */
  165.     1500000,        /* 1.5 MHz ? (hand tuned) */
  166.     { 23, 23 },
  167.     { 0 },
  168.     { 0 },
  169.     { 0 },
  170.     { 0 }
  171. };
  172.  
  173.  
  174.  
  175. static struct MachineDriver machine_driver_scregg =
  176. {
  177.     /* basic machine hardware */
  178.     {
  179.         {
  180.             CPU_M6502,
  181.             1500000,
  182.             eggs_readmem,eggs_writemem,0,0,
  183.             interrupt,1
  184.         }
  185.     },
  186.     57, 3072,        /* frames per second, vblank duration taken from Burger Time */
  187.     1,      /* single CPU, no need from interleaving  */
  188.     0,
  189.  
  190.     /* video hardware */
  191.     32*8, 32*8, { 1*8, 31*8-1, 1*8, 31*8-1 },
  192.     gfxdecodeinfo,
  193.     8, 8,
  194.     btime_vh_convert_color_prom,
  195.  
  196.     VIDEO_TYPE_RASTER|VIDEO_MODIFIES_PALETTE,
  197.     0,
  198.     btime_vh_start,
  199.     generic_vh_stop,
  200.     eggs_vh_screenrefresh,
  201.  
  202.     /* sound hardware */
  203.     0,0,0,0,
  204.     {
  205.         {
  206.             SOUND_AY8910,
  207.             &ay8910_interface
  208.         }
  209.     }
  210. };
  211.  
  212.  
  213.  
  214. ROM_START( scregg )
  215.     ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
  216.     ROM_LOAD( "scregg.e14",   0x3000, 0x1000, 0x29226d77 )
  217.     ROM_LOAD( "scregg.d14",   0x4000, 0x1000, 0xeb143880 )
  218.     ROM_LOAD( "scregg.c14",   0x5000, 0x1000, 0x4455f262 )
  219.     ROM_LOAD( "scregg.b14",   0x6000, 0x1000, 0x044ac5d2 )
  220.     ROM_LOAD( "scregg.a14",   0x7000, 0x1000, 0xb5a0814a )
  221.     ROM_RELOAD(               0xf000, 0x1000 )        /* for reset/interrupt vectors */
  222.  
  223.     ROM_REGION( 0x6000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  224.     ROM_LOAD( "scregg.j12",   0x0000, 0x1000, 0xa485c10c )
  225.     ROM_LOAD( "scregg.j10",   0x1000, 0x1000, 0x1fd4e539 )
  226.     ROM_LOAD( "scregg.h12",   0x2000, 0x1000, 0x8454f4b2 )
  227.     ROM_LOAD( "scregg.h10",   0x3000, 0x1000, 0x72bd89ee )
  228.     ROM_LOAD( "scregg.g12",   0x4000, 0x1000, 0xff3c2894 )
  229.     ROM_LOAD( "scregg.g10",   0x5000, 0x1000, 0x9c20214a )
  230.  
  231.     ROM_REGION( 0x0040, REGION_PROMS )
  232.     ROM_LOAD( "screggco.c6",  0x0000, 0x0020, 0xff23bdd6 )    /* palette */
  233.     ROM_LOAD( "screggco.b4",  0x0020, 0x0020, 0x7cc4824b )    /* unknown */
  234. ROM_END
  235.  
  236. ROM_START( eggs )
  237.     ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
  238.     ROM_LOAD( "e14.bin",      0x3000, 0x1000, 0x4e216f9d )
  239.     ROM_LOAD( "d14.bin",      0x4000, 0x1000, 0x4edb267f )
  240.     ROM_LOAD( "c14.bin",      0x5000, 0x1000, 0x15a5c48c )
  241.     ROM_LOAD( "b14.bin",      0x6000, 0x1000, 0x5c11c00e )
  242.     ROM_LOAD( "a14.bin",      0x7000, 0x1000, 0x953faf07 )
  243.     ROM_RELOAD(               0xf000, 0x1000 )   /* for reset/interrupt vectors */
  244.  
  245.     ROM_REGION( 0x6000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  246.     ROM_LOAD( "j12.bin",      0x0000, 0x1000, 0xce4a2e46 )
  247.     ROM_LOAD( "j10.bin",      0x1000, 0x1000, 0xa1bcaffc )
  248.     ROM_LOAD( "h12.bin",      0x2000, 0x1000, 0x9562836d )
  249.     ROM_LOAD( "h10.bin",      0x3000, 0x1000, 0x3cfb3a8e )
  250.     ROM_LOAD( "g12.bin",      0x4000, 0x1000, 0x679f8af7 )
  251.     ROM_LOAD( "g10.bin",      0x5000, 0x1000, 0x5b58d3b5 )
  252.  
  253.     ROM_REGION( 0x0040, REGION_PROMS )
  254.     ROM_LOAD( "eggs.c6",      0x0000, 0x0020, 0xe8408c81 )    /* palette */
  255.     ROM_LOAD( "screggco.b4",  0x0020, 0x0020, 0x7cc4824b )    /* unknown */
  256. ROM_END
  257.  
  258.  
  259.  
  260. GAME( 1983, scregg, 0,      scregg, scregg, 0, ROT270, "Technos", "Scrambled Egg" )
  261. GAME( 1983, eggs,   scregg, scregg, scregg, 0, ROT270, "[Technos] Universal USA", "Eggs" )
  262.